#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
void q_sort(int* p, int l, int r)
{
    if (l >= r)
        return;
    int x = p[l];
    int i = l - 1;
    int j = r + 1;
    while (i < j)
    {
        do
        {
            i++;
        } while (p[i] < x);
        do
        {
            j--;
        } while (p[j] > x);
        if (i < j)
        {
            int te = p[i];
            p[i] = p[j];
            p[j] = te;
        }
    }
    q_sort(p, l, j);
    q_sort(p, j + 1, r);
}
int main()
{
    int n = 0;
    FILE* in = fopen("text.in", "w");
    FILE* out = fopen("text.out", "r");
    fscanf(in,"%d", &n);
    int i = 0;
    int* p = (int*)malloc(sizeof(int) * n);
    for (i = 0; i < n; i++)
    {
        fscanf(in,"%d", &p[i]);
    }
    q_sort(p, 0, n - 1);
    for (i = 0; i < n; i++)
    {
        fprintf(out,"%d ", p[i]);
    }
    fprintf(out,"\n");
    fclose(in);
    in = NULL;
    fclose(out);
    out = NULL;
    free(p);
    p = NULL;
    return 0;
}